﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AddEnlistRecord.ascx.vb"
    Inherits="WebForm_ManageEnlistRecord_AddEnlistRecord" %>
<%@ Register Src="~/WebForm/CommonControl/VolunteerQueryControl.ascx" TagName="VolunteerQueryControl"
    TagPrefix="uc1" %>

<script src="<%=Me.ResolveUrl("~/js/JScript.js") %>" type="text/javascript"></script>

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
    SelectMethod="BLL_Select" TypeName="BLL_AddEnlistRecord"></asp:ObjectDataSource>
<table align="center">
    <tr>
        <td class="Section">
            <asp:Label ID="lblEnlistHeaderListInfo" runat="server" meta:resourcekey="lblEnlistHeaderListInfo"></asp:Label>
        </td>
    </tr>
    <tr>
        <td>
            <My:MyGridView ID="gv" runat="server" SkinID="pager" AllowHoverSelect="False" AllowHoverEffect="False"
                MySortDirection="Ascending" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False"
                DataKeyNames="EnlistID" AllowSorting="True">
                <Columns>
                    <asp:TemplateField>
                        <headertemplate>
            <asp:Button id="btnGetIn" runat="server" meta:resourcekey="btnGetIn" 
                CommandArgument="btnGetIn" onclick="btnGetIn_Click"></asp:Button>
        
</headertemplate>
                        <itemtemplate>
                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Select" 
                    Text="<%$ Resources:Select %>"></asp:LinkButton>
            </itemtemplate>
                        <itemstyle horizontalalign="Center" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="OrganizationName" meta:resourcekey="bfOrganizationName"
                        SortExpression="OrganizationName">
                        <headerstyle width="100px" />
                        <itemstyle width="100px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="EnlistName" meta:resourcekey="bfEnlistName" SortExpression="EnlistName">
                        <headerstyle width="120px" />
                        <itemstyle width="120px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Description" meta:resourcekey="bfDescription" SortExpression="Description">
                        <headerstyle width="120px" />
                        <itemstyle width="120px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="StartDate" meta:resourcekey="bfStartDate" SortExpression="StartDate"
                        DataFormatString="{0:yyyy/MM/dd}">
                        <itemstyle horizontalalign="Center" />
                    </asp:BoundField>
                    <asp:BoundField DataField="EndDate" meta:resourcekey="bfEndDate" SortExpression="EndDate"
                        DataFormatString="{0:yyyy/MM/dd}">
                        <itemstyle horizontalalign="Center" />
                    </asp:BoundField>
                    <asp:BoundField DataField="PeopleRequired" meta:resourcekey="bfPeopleRequired" SortExpression="PeopleRequired">
                        <itemstyle horizontalalign="Center" />
                    </asp:BoundField>
                </Columns>
            </My:MyGridView>
        </td>
    </tr>
    <tr>
        <td>
            <br />
        </td>
    </tr>
    <tr>
        <td class="Section">
            <asp:Label ID="lblVolunteerListInfo" runat="server" meta:resourcekey="lblVolunteerListInfo"></asp:Label>
        </td>
    </tr>
    <tr>
        <td>
            <table>
                <tr>
                    <td>
                        <uc1:VolunteerQueryControl ID="VolunteerQueryControl1" runat="server" LoadOnStartUp="true" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="lblTrainingBHour" runat="server" Text="<%$ Resources:TrainingWHourLessThan %>"></asp:Label>
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtTrainingBHour" runat="server"></asp:TextBox>
                                </td>
                                <td align="right">
                                    <asp:Button ID="btnQuery" runat="server" meta:resourcekey="btnQuery" Text="<%$ Resources:Query %>" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td>
            <My:MyGridView ID="GridView_Volunteers" runat="server" SkinID="pager" DataKeyNames="VolunteerID"
                AllowSorting="True" AllowHoverEffect="False" AllowHoverSelect="False" AllowPaging="true"
                MySortDirection="Ascending" meta:resourcekey="GridView_Volunteers">
                <Columns>
                    <asp:TemplateField>
                        <itemtemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" Enabled='<%# Bind("IsEnable") %>' />
                        </itemtemplate>
                        <headertemplate>
                            <input id="cbCheckAll" onclick="Check2(this,'GridView_Volunteers','CheckBox1');"
                                runat="server" type="checkbox" /><asp:Label ID="Label2" runat="server" Text="全選"></asp:Label>
                        </headertemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Resources:VOrganizationName %>" SortExpression="VOrganizationName">
                        <itemtemplate>
                <%#Eval("VOrganizationName")%>
            </itemtemplate>
                        <itemstyle horizontalalign="Center" />
                    </asp:TemplateField>
                       <My:VolunteerIDBoundField DataField="VolunteerID" HeaderText="<%$ Resources:VolunteerID %>"
            ReadOnly="True" SortExpression="VolunteerID" />
                  <%--  <asp:BoundField DataField="VolunteerID" HeaderText="<%$ Resources:VolunteerID %>"
                        SortExpression="VolunteerID" />--%>
                    <asp:BoundField DataField="VolunteerName" HeaderText="<%$ Resources:VolunteerName %>"
                        SortExpression="VolunteerName" />
                    <asp:BoundField DataField="TrainingWHour" HeaderText="<%$ Resources:TrainingWHour %>"
                        SortExpression="TrainingWHour" />
                </Columns>
            </My:MyGridView>
            <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}"
                SelectMethod="BLL_Select_Volunteer" TypeName="BLL_AddEnlistRecord">
                <SelectParameters>
              <%--      <asp:Parameter Name="Region" Type="String" />
                    <asp:Parameter Name="Region2" Type="String" />--%>
                    <asp:Parameter Name="UOrganizationID" Type="String" />
                    <asp:Parameter Name="VolunteerId" Type="String" />
                    <asp:Parameter Name="VolunteerName" Type="String" />
                    <asp:Parameter Name="TEL" Type="String" />
                    <asp:Parameter Name="EnlistID" Type="Int32" />
                    <asp:Parameter Name="VOrganizationID" Type="Int32" />
                    <asp:Parameter Name="TrainingWHour" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </td>
    </tr>
</table>
